/*
*Copyright 2021-2023 NERCIS
*
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/

package cn.ac.nercis.pes.community.model.vo.knowledge;

import javafx.beans.property.SimpleStringProperty;
import org.apache.commons.lang3.StringUtils;

/**
 * 测评方法信息（知识库）修改视图模型
 *
 * @author zpy
 * @version 1.0.0
 */
public class KmUnitTargetVO {
    private final SimpleStringProperty id = new SimpleStringProperty();
    private final SimpleStringProperty unitTargetId = new SimpleStringProperty();

    private final SimpleStringProperty content = new SimpleStringProperty();
    private final SimpleStringProperty score = new SimpleStringProperty();
    private boolean change = false;

    public boolean isChange() {
        return change;
    }

    public void resetChange() {
        change = false;
    }

    public String getId() {
        return id.get();
    }

    public SimpleStringProperty idProperty() {
        return id;
    }

    public void setId(String id) {
        this.id.set(id);
    }

    public String getUnitTargetId() {
        return unitTargetId.get();
    }


    public SimpleStringProperty unitTargetIdProperty() {
        return unitTargetId;
    }

    public void setUnitTargetId(String unitTargetId) {
        if (!StringUtils.equals(getUnitTargetId(), unitTargetId)) {
            change = true;
        }
        this.unitTargetId.set(unitTargetId);
    }

    public String getContent() {
        return content.get();
    }

    public SimpleStringProperty contentProperty() {
        return content;
    }

    public void setContent(String content) {
        if (!StringUtils.equals(getContent(), content)) {
            change = true;
        }
        this.content.set(content);
    }

    public String getScore() {
        return score.get();
    }

    public SimpleStringProperty scoreProperty() {
        return score;
    }

    public void setScore(String score) {
        if (!StringUtils.equals(getScore(), score)) {
            change = true;
        }
        this.score.set(score);
    }
}